import request from "@/utils/request";
export const getInfoListAPi = (params: any) => {
  return request({
    url: "/carfilm.Factory/index",
    method: "get",
    params,
  });
};

export const getInfoApi = (id: number) => {
  return request({
    url: "/carfilm.Factory/detail",
    method: "get",
    params: { id },
  });
};

export const deleteApi = (id: number) => {
  return request({
    url: "/carfilm.Factory/delete",
    method: "delete",
    params: { id },
  });
};

export const addApi = (data: any) => {
  return request({
    url: "/carfilm.Factory/add",
    method: "post",
    data,
  });
};

export const editApi = (data: any) => {
  return request({
    url: "/carfilm.Factory/update",
    method: "put",
    data,
  });
};

export const getProductListAPi = (params: any) => {
  return request({
    url: "/carfilm.Factory/productList",
    method: "get",
    params,
  });
};

export const deleteProductApi = (id: number) => {
  return request({
    url: "/carfilm.Factory/productDelete",
    method: "delete",
    params: { id },
  });
};

export const addProductApi = (data: any) => {
  return request({
    url: "/carfilm.Factory/productAdd",
    method: "post",
    data,
  });
};

export const editProductApi = (data: any) => {
  return request({
    url: "/carfilm.Factory/productUpdate",
    method: "put",
    data,
  });
};

export const editUserFactoryApi = (data: any) => {
  return request({
    url: "/carfilm.Factory/editUserFactory",
    method: "put",
    data,
  });
};
